from glob import glob


filelist = [ i.split(".as")[0] for i in glob( "*.as" ) if i.find("ListOf") == -1 and i != "FunctionNode.as"]

arraystring = '"'

arraystring += '",\n \t\t"'.join( filelist )

print arraystring

outfile = open("ListOfNodes.as", "w" )

outfile.write("""
/**
 * @author pbalogh
 */
package functions
{
	public class ListOfNodes 
	{
		public static var LIST : Array = [ 
		""")

outfile.write( arraystring )

outfile.write( """\"];

		public function ListOfNodes()
		{
			var fn : Class;
""")

outfile.write( "".join( [ "\t\t\tfn = functions." + i + ";\n" for i in filelist] ) )

outfile.write( """
		}
	}
}
""")

outfile.close()


